<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>简易选项卡</title>
    <style>
        *{
            margin: 0;
            padding: 0;
        }
        html,body{
            height: 100%;
            width: 100%;
        }
        ul{
            list-style: none;
            display: flex;
            align-items: center;
            height: 10%;
        }
        ul>li{
            flex: 1;
            height: 100%;
            display: flex;
            justify-content: center;
            align-items: center;
            font-size: 20px;
        }
        .active{
            border-bottom: 2px solid orange;
            color:orange;
        }
    </style>
</head>
<body>
    <ul>
        <li class="active">正在热映</li>
        <li>今日上新</li>
    </ul>
    <script>
        let lis = document.querySelectorAll('li')

        lis[0].onclick  = ()=>{
            lis[0].classList.add('active')
            lis[1].classList.remove('active')
        }

        lis[1].onclick  = ()=>{
            lis[1].classList.add('active')
            lis[0].classList.remove('active')
        }
    </script>
</body>
</html>